#ifdef __cplusplus
extern "C" {
#endif
static void init_8259s(void)
{
        static const unsigned irq0_int = 0x20, irq8_int = 0x28;
/**/

/* Initialization Control Word #1 (ICW1) */
        outportb(0x20, 0x11);
        outportb(0xA0, 0x11);
/* ICW2:
route IRQs 0-7 to INTs 20h-27h */
        outportb(0x21, irq0_int);
/* route IRQs 8-15 to INTs 28h-2Fh */
        outportb(0xA1, irq8_int);
/* ICW3 */
        outportb(0x21, 0x04);
        outportb(0xA1, 0x02);
/* ICW4 */
        outportb(0x21, 0x01);
        outportb(0xA1, 0x01);
/* enable IRQ0 (timer) and IRQ1 (keyboard) */
        outportb(0x21, ~0x03);
        outportb(0xA1, ~0x00);
}
#ifdef __cplusplus
}
#endif

